import requests
from bs4 import BeautifulSoup
newsurl = 'http://sports.sina.com.cn/'
res = requests.get(newsurl)
res.encoding = 'utf-8'
html_content = res.text

#解析
soup = BeautifulSoup(html_content,'html.parser')
#select 其中的字符串不带点的则是去标签， 带点的则是取标签内属性
#取出来的都是他妈的数组
for news in soup.select('h3'):
    print(news)
    print("=====================================================>")
    if len(news.select('span')) > 0:
        print(news.select('span')[0].text)

